import React, { memo, useCallback } from 'react'
import { Button, Result } from 'antd'

export default memo(function AdminError(props) {
  const { history } = props
  const { userId } = props.route
  const handleClick = useCallback(() => {
    userId ? history.push(`/blog/home/u/${userId}`) : history.push('/')
  }, [history, userId])
  return (
    <div>
      <Result
        status="404"
        title="404"
        subTitle="资源不存在.."
        extra={
          <Button type="primary" onClick={handleClick}>
            回到工作台
          </Button>
        }
      />
    </div>
  )
})
